
342 B.R. 671 (2006)
In re Carlietha M. MURPHY, Debtor.
No. 06-00014.
United States Bankruptcy Court, District of Columbia.
February 22, 2006.
*672 Juaria L. Nelson, Law Offices of Juaria L. Nelson, Camp Springs, MD, for Debtor.

DECISION RE PENDING MOTIONS
S. MARTIN TEEL, JR., Bankruptcy Judge.
The outcome of two pending motions depends on the date and time of the filing of the debtor's petition under 11 U.S.C. § 301 to commence this case. Even though the debtor's counsel, as an authorized electronic filer of case papers, electronically opened a docket reflecting this case as commenced on January 17, 2006, she did not file the debtor's petition until January 18, 2006. The court will treat the petition as effective to commence a bankruptcy case at the time of its filing, and as not relating back to the opening of the docket on the previous day.
The belated filing of the petition mandates denial of the chapter 13 trustee's motion to dismiss on the basis of 11 U.S.C. § 109(h). Because the debtor's petition was filed only on January 18, 2006, and does not relate back to January 17, 2006, the debtor received credit counseling on January 17, 2006, which was "during the 180-day period preceding the date of filing of the petition" as required by § 109(h).
By the same token, however, the belated filing of the petition requires granting of the motion of a mortgagee[1] for relief from the automatic stay to permit the purchaser at a foreclosure sale of the debtor's home to obtain a deed pursuant to that sale and to evict the debtor from her home. Although a case had been electronically docketed on January 17, 2006, that opening of the case was not the filing of a petition giving rise to an automatic stay under 11 U.S.C. § 362(a), and no automatic stay was in effect when the foreclosure sale was held.

I
On January 17, 2006, at 7:13 p.m. EST, the debtor's attorney, Juaria L. Nelson, electronically filed in this court an unsigned Notice to Individual Consumer Debtor under § 342(b) of the Bankruptcy Code which listed Carlietha Maria Murphy as the debtor. Nelson thought she was filing a petition under chapter 13 of the Bankruptcy Code on behalf of Murphy, and as part of the electronic filing transaction paid the filing fee required for such a case and submitted a docket text which reads:
Chapter 13 Voluntary Petition. Fee Amount $189 Filed by Carlietha Maria Murphy Mailing Matrix due 01/20/2006. (Nelson, Juaria).
The docketing of the filing as a petition resulted in the opening of a case docket showing Murphy as the debtor under the new case number of 06-00014. Nelson received a notice of her filing reciting the time of filing and the docket text she had placed on the docket and apparently did *673 not realize that what she had filed was not a petition.
On January 17, 2006, Nelson also electronically filed on the debtor's behalf in the newly opened case three other documents:
a chapter 13 plan bearing Nelson's signature;
a Statement of Social Security Number bearing Murphy's signature as the debtor; and
a certificate reciting that Murphy had received credit counseling under 11 U.S.C. § 109(h) on January 17, 2006.
On January 18, 2006, the clerk issued to the debtor through electronic transmission to Nelson a notice reciting:
ELECTRONIC DEFICIENCY NOTICE. Filer is hereby notified that the document entry linked hereto contains an error which requires corrective action. THE ATTACHED PDF RELATES TO A DIFFERENT DOCUMENT. PLEASE FILE AN AMENDED PLEADING WITH THE CORRECT PDF LINKING IT TO THE ORIGINAL PLEADING (Re: Related Document #: 1 Chapter 13 Voluntary Petition). YOU HAVE UNTIL 1/18/2006 TO CORRECT THIS DEFICIENCY. IF YOU FAIL TO DO SO, THE SUBMISSION MAY BE STRICKEN.
Nelson filed the debtor's signed petition on January 18, 2006, but sometime after the foreclosure sale had already been held.

II
Section 109(h) does not simply require the debtor to obtain credit counseling before she files her bankruptcy petition. Instead, it specifies that credit counseling must be obtained prior to "the date of the filing of the petition." 11 U.S.C. § 109(h)(1). "It is settled that when a statute requires an act to be done within a specified number of days prior to a fixed date, the last day, namely, the fixed date, is to be excluded . . . in making the calculation." State v. Zaller, 142 Ohio St. 186, 50 N.E.2d 991, 991-92 (1943); accord Stein Steel & Supply Co. v. Tate, 94 Ga.App. 517, 95 S.E.2d 437, 438-39 (1956); Baugh v. Rural High School Dist. No. 5, 185 Kan. 123, 340 P.2d 891, 898 (1959); Murchison v. Darden, 171 S.W.2d 220, 221 (Tex.Civ. App.1943). Accordingly, the latest that the debtor could have obtained credit counseling under § 109(h) was the date prior to her petition date. The trustee mistakenly believed that because the docket reflects that a petition was filed on January 17, 2006, the debtor's credit counseling on January 17, 2006, did not satisfy the statute. However, the petition was not filed until January 18, 2006, and thus the debtor (inadvertently) complied with the statute.

III
Because the debtor's petition was not filed until after the foreclosure sale was held, no automatic stay was in place to stay the sale. Once the gavel fell at the foreclosure sale, only the purchaser's rights arising from the sale remained to be enforced. This court's decisions in In re Flowers, 94 B.R. 3 (Bankr.D.D.C.1988), and In re Bobo, 246 B.R. 453 (Bankr. D.D.C.2000), warrant granting relief from the automatic stay to permit the purchaser to obtain a foreclosure sale deed and to evict the debtor from the real property sold.

IV
The court writes further to distinguish a decision, relied upon by the mortgagee, which could be read as requiring treating the petition as a nullity. In In re Marion, Case No. 05-67816 JPK (Bankr. *674 N.D.Ind. Jan. 5, 2006), the debtor's attorney filed a mailing matrix and erroneously docketed it as a petition commencing a case. The court entered an order dismissing the case, as no petition had been filed to commence a case. The next day, the debtor's attorney filed a petition in the case and was notified that "Case Dismissed on 10/24/05. Document cannot be processed." Three days later, the debtor's attorney filed a motion to reconsider the dismissal of the case. The court ruled that there was no case pending in which to consider permitting an amended petition.
The instant case is different. The clerk permitted the debtor's attorney to correct the mistake in opening the case and a petition was filed before the court took any action to dismiss the case for lack of a petition. The petition, although labeled an amended petition, was effective to commence a case. Although the docket for the case was prematurely opened on the preceding day, there is no reason to require the debtor's attorney to open a new docket and pay a new filing fee related to the petition. The filing fee paid with the premature filing was for commencing a bankruptcy case, but when no case was actually commenced until the petition was filed the next day, the filing fee may be treated as paid towards the filing of that petition.
Appropriate orders follow.
NOTES
[1]  The mortgagee is Deutsche Bank National Trust Company, which was secured by mortgage in the form of a deed of trust recorded against the debtor's home. The foreclosure sale was a non-judicial sale by the trustees under the deed of trust.
